package a.a;

import a.c.d;
import a.c.e;
import a.c.k;
import a.c.n;
import a.c.q;
import a.c.w;
import a.c.*;
import a.i.a.c;
import a.i.db;
import a.i.h;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

class v
{
  static final double a = 0.0001D;
  
  protected static void a(q paramq, x paramx, boolean paramBoolean)
  {
    int k = m.b;
    boolean bool = m.a;
    if (k == 0) {
      if (paramq.m() == 0) {
        return;
      }
    }
    int i = paramq.k();
    x localx1 = db.a(new double[i]);
    x localx2 = db.a(new int[i]);
    x localx3 = db.a(new ArrayList[i]);
    x localx4 = db.a(new double[i]);
    w localw = paramq.v();
    label225:
    label247:
    label252:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale1 = localw.d();
      ArrayList localArrayList = new ArrayList();
      Object localObject1;
      e locale2;
      do
      {
        if (bool) {
          break label1087;
        }
        localObject1 = paramq.v();
        do
        {
          if (!((w)localObject1).e()) {
            break label225;
          }
          locale2 = ((w)localObject1).d();
          localx3.a(locale2, new ArrayList());
          localx4.a(locale2, 0.0D);
          if (bool) {
            break;
          }
          if (locale2 != locale1)
          {
            localx1.a(locale2, 0.0D);
            localx2.a(locale2, -1);
            if (k != 0) {
              continue;
            }
            if (!bool) {}
          }
          else
          {
            localx1.a(locale2, 1.0D);
            localx2.a(locale2, 0);
          }
          ((w)localObject1).f();
        } while (!bool);
        localObject1 = new h(i);
      } while (k != 0);
      ((h)localObject1).a(locale1);
      break label537;
      if (!((h)localObject1).g()) {}
      do
      {
        do
        {
          Object localObject3;
          while (k != 0)
          {
            locale2 = (e)((h)localObject1).c();
            localArrayList.add(locale2);
            do
            {
              localObject2 = locale2.h();
              do
              {
                if (localObject2 == null) {
                  break;
                }
                locale3 = ((d)localObject2).f();
                if (bool) {
                  break label517;
                }
                if (localx2.getInt(locale3) < 0)
                {
                  ((h)localObject1).a(locale3);
                  localx2.a(locale3, localx2.getInt(locale2) + 1);
                }
                if (k == 0)
                {
                  if (localx2.getInt(locale3) == localx2.getInt(locale2) + 1)
                  {
                    if (k == 0)
                    {
                      if (localx1.getDouble(locale3) + localx1.getDouble(locale2) > 1.7976931348623157E+308D) {
                        throw new ArithmeticException("Number of Paths between " + locale1 + " and " + locale3 + " overflows double");
                      }
                      localx1.a(locale3, localx1.getDouble(locale3) + localx1.getDouble(locale2));
                    }
                    localObject3 = (ArrayList)localx3.get(locale3);
                    ((ArrayList)localObject3).add(locale2);
                    localx3.a(locale3, localObject3);
                  }
                  localObject2 = ((d)localObject2).i();
                }
              } while (!bool);
              if ((k != 0) || (paramBoolean)) {
                break;
              }
            } while (k != 0);
            if (bool) {
              break label807;
            }
            localObject2 = locale2.i();
            if (localObject2 == null) {
              break label247;
            }
            e locale3 = ((d)localObject2).e();
            if (bool) {
              break label252;
            }
            if (localx2.getInt(locale3) < 0)
            {
              ((h)localObject1).a(locale3);
              localx2.a(locale3, localx2.getInt(locale2) + 1);
            }
            if (k == 0)
            {
              if (localx2.getInt(locale3) == localx2.getInt(locale2) + 1)
              {
                if (k == 0)
                {
                  if (localx1.getDouble(locale3) + localx1.getDouble(locale2) > 1.7976931348623157E+308D) {
                    throw new ArithmeticException("Number of Paths between " + locale1 + " and " + locale3 + " overflows double");
                  }
                  localx1.a(locale3, localx1.getDouble(locale3) + localx1.getDouble(locale2));
                }
                localObject3 = (ArrayList)localx3.get(locale3);
                ((ArrayList)localObject3).add(locale2);
                localx3.a(locale3, localObject3);
              }
              localObject2 = ((d)localObject2).j();
            }
            if (!bool) {
              break;
            }
          }
          if (localArrayList.isEmpty()) {
            break label1051;
          }
          locale2 = (e)localArrayList.remove(localArrayList.size() - 1);
          Object localObject2 = (ArrayList)localx3.get(locale2);
          int j = ((ArrayList)localObject2).size();
          if (j != 0) {}
          while (k != 0)
          {
            localObject3 = (e)((ArrayList)localObject2).get(j - 1);
            double d1 = localx4.getDouble(localObject3) + localx1.getDouble(localObject3) * (1.0D + localx4.getDouble(locale2)) / localx1.getDouble(locale2);
            if (bool) {
              break;
            }
            if (d1 == (1.0D / 0.0D)) {
              throw new ArithmeticException("Centrality index of " + localObject3 + " too high");
            }
            localx4.a(localObject3, d1);
            j--;
            if (!bool) {
              break label819;
            }
          }
        } while (locale2 == locale1);
        double d2 = paramx.getDouble(locale2) + localx4.getDouble(locale2);
        if (k != 0) {
          break label1060;
        }
        if (bool) {
          break;
        }
        if (d2 == (1.0D / 0.0D)) {
          throw new ArithmeticException("Centrality index of " + locale2 + " too high");
        }
        paramx.a(locale2, d2);
        if (k != 0) {
          break label1060;
        }
      } while (!bool);
      localw.f();
    } while (!bool);
    label517:
    label537:
    label807:
    label819:
    paramq.a(localx1);
    label1051:
    label1060:
    paramq.a(localx4);
    paramq.a(localx3);
    if (k == 0) {
      label1087:
      paramq.a(localx2);
    }
  }
  
  protected static void a(q paramq, x paramx, k paramk, boolean paramBoolean)
  {
    int m = m.b;
    boolean bool = m.a;
    if (m == 0) {
      if (paramq.m() == 0) {
        return;
      }
    }
    int i = paramq.k();
    x localx1 = db.a(new double[i]);
    x localx2 = db.a(new ArrayList[i]);
    x localx3 = db.a(new double[i]);
    x localx4 = db.a(new double[i]);
    x localx5 = db.a(new boolean[i]);
    c localc = new c(paramq);
    w localw = paramq.v();
    label264:
    label266:
    label470:
    label484:
    label485:
    label487:
    label509:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale1 = localw.d();
      ArrayList localArrayList = new ArrayList();
      Object localObject1 = paramq.v();
      e locale2;
      do
      {
        if (!((w)localObject1).e()) {
          break;
        }
        if (m != 0) {
          break label266;
        }
        locale2 = ((w)localObject1).d();
        localx2.a(locale2, new ArrayList());
        localx3.a(locale2, 0.0D);
        localx1.a(locale2, 0.0D);
        localx4.a(locale2, 1.7976931348623157E+308D);
        localx5.a(locale2, false);
        ((w)localObject1).f();
        if (bool) {
          break label264;
        }
      } while (!bool);
      localx4.a(locale1, 0.0D);
      localx1.a(locale1, 1.0D);
      localx5.a(locale1, true);
      if (m == 0) {
        localc.d();
      }
      localObject1 = locale1.h();
      double d2;
      do
      {
        if (localObject1 == null) {
          break;
        }
        locale2 = ((d)localObject1).f();
        d2 = a(paramk, (d)localObject1);
        a(d2, locale2);
        localx4.a(locale2, d2);
        a(localc, locale2, d2);
        ((Collection)localx2.get(locale2)).add(locale1);
        localObject1 = ((d)localObject1).i();
        if (m != 0) {
          break label484;
        }
        if (bool) {
          break label470;
        }
      } while (!bool);
      if (m == 0)
      {
        if (m != 0) {
          break label484;
        }
        if (!paramBoolean)
        {
          localObject1 = locale1.i();
          do
          {
            if (localObject1 == null) {
              break;
            }
            locale2 = ((d)localObject1).e();
            d2 = a(paramk, (d)localObject1);
            a(d2, locale2);
            localx4.a(locale2, d2);
            if (m != 0) {
              break label487;
            }
            a(localc, locale2, d2);
            ((Collection)localx2.get(locale2)).add(locale1);
            localObject1 = ((d)localObject1).j();
            if (bool) {
              break label485;
            }
          } while (!bool);
        }
      }
      if (m == 0) {
        localArrayList.add(locale1);
      }
      do
      {
        if (!localc.a()) {
          break label1040;
        }
        Object localObject2;
        while (m != 0)
        {
          double d1;
          e locale3;
          double d5;
          double d6;
          Collection localCollection;
          do
          {
            localObject1 = localc.b();
            d1 = localx4.getDouble(localObject1);
            localArrayList.add(localObject1);
            localx5.a(localObject1, true);
            do
            {
              localObject2 = (List)localx2.get(localObject1);
              int k = ((List)localObject2).size();
              do
              {
                if (k == 0) {
                  break;
                }
                localx1.a(localObject1, localx1.getDouble(localObject1) + localx1.getDouble(((List)localObject2).get(k - 1)));
                k--;
                if ((m == 0) && (bool)) {
                  break label633;
                }
              } while (!bool);
              if (m != 0) {
                break label509;
              }
              a(localx1.getDouble(localObject1), localObject1);
              locald = ((e)localObject1).h();
              do
              {
                if (locald == null) {
                  break;
                }
                locale3 = locald.f();
                if (bool) {
                  break label833;
                }
                if (!localx5.getBool(locale3))
                {
                  d5 = localx4.getDouble(locale3);
                  d6 = d1 + a(paramk, locald);
                  a(d6, localObject1);
                  if (m == 0) {
                    if (Math.abs(d6 - d5) < 0.0001D)
                    {
                      ((Collection)localx2.get(locale3)).add(localObject1);
                      if (m != 0) {
                        continue;
                      }
                      if (!bool) {
                        break label815;
                      }
                    }
                  }
                  if (m != 0) {
                    continue;
                  }
                  if (d6 < d5)
                  {
                    localx4.a(locale3, d6);
                    a(localc, locale3, d6);
                    localCollection = (Collection)localx2.get(locale3);
                    localCollection.clear();
                    localCollection.add(localObject1);
                  }
                }
                locald = locald.i();
              } while (!bool);
              if ((m != 0) || (paramBoolean)) {
                break;
              }
            } while (m != 0);
            if (bool) {
              break label1085;
            }
            locald = ((e)localObject1).i();
            if (locald == null) {
              break;
            }
            locale3 = locald.e();
          } while (bool);
          if (!localx5.getBool(locale3))
          {
            d5 = localx4.getDouble(locale3);
            d6 = d1 + a(paramk, locald);
            a(d6, localObject1);
            if (m == 0) {
              if (Math.abs(d6 - d5) < 0.0001D)
              {
                ((Collection)localx2.get(locale3)).add(localObject1);
                if (m != 0) {
                  break label1037;
                }
                if (!bool) {
                  break label1028;
                }
              }
            }
            if (m != 0) {
              break label1037;
            }
            if (d6 < d5)
            {
              localx4.a(locale3, d6);
              a(localc, locale3, d6);
              localCollection = (Collection)localx2.get(locale3);
              localCollection.clear();
              localCollection.add(localObject1);
            }
          }
          d locald = locald.j();
          if (!bool) {
            break;
          }
        }
        do
        {
          if (localArrayList.isEmpty()) {
            break label1273;
          }
          localObject1 = (e)localArrayList.remove(localArrayList.size() - 1);
          List localList = (List)localx2.get(localObject1);
          int j = localList.size();
          if (j != 0) {}
          while (m != 0)
          {
            localObject2 = (e)localList.get(j - 1);
            double d4 = localx3.getDouble(localObject2) + localx1.getDouble(localObject2) * (1.0D + localx3.getDouble(localObject1)) / localx1.getDouble(localObject1);
            a(d4, localObject2);
            localx3.a(localObject2, d4);
            j--;
            if ((m == 0) && (bool)) {
              break;
            }
            if (!bool) {
              break label1099;
            }
          }
          if (localObject1 == locale1) {
            break;
          }
          double d3 = paramx.getDouble(localObject1) + localx3.getDouble(localObject1);
          a(d3, localObject1);
          paramx.a(localObject1, d3);
          if ((m != 0) || (m != 0)) {
            break label1282;
          }
          if (bool) {
            break label1280;
          }
        } while (m != 0);
      } while (!bool);
      localw.f();
    } while (!bool);
    label633:
    label1273:
    return;
  }
  
  protected static void a(q paramq, n paramn, boolean paramBoolean)
  {
    int k = m.b;
    boolean bool = m.a;
    if (k == 0) {
      if (paramq.m() == 0) {
        return;
      }
    }
    int i = paramq.k();
    x localx1 = db.a(new double[i]);
    x localx2 = db.a(new int[i]);
    x localx3 = db.a(new ArrayList[i]);
    n localn = db.b(new double[paramq.m()]);
    x localx4 = db.a(new double[i]);
    w localw = paramq.v();
    label80:
    label601:
    label871:
    label885:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale1 = localw.d();
      ArrayList localArrayList = new ArrayList();
      Object localObject1;
      e locale2;
      do
      {
        localObject1 = paramq.w();
        do
        {
          if (!((a.c.m)localObject1).e()) {
            break label159;
          }
          localn.a(((a.c.m)localObject1).a(), 0.0D);
          ((a.c.m)localObject1).f();
          if ((k == 0) && (bool)) {
            break;
          }
        } while (!bool);
        if (k != 0) {
          break label80;
        }
        localObject1 = paramq.v();
        do
        {
          if (!((w)localObject1).e()) {
            break label289;
          }
          locale2 = ((w)localObject1).d();
          localx3.a(locale2, new ArrayList());
          localx4.a(locale2, 0.0D);
          if (bool) {
            break;
          }
          if (locale2 != locale1)
          {
            localx1.a(locale2, 0.0D);
            localx2.a(locale2, -1);
            if (k != 0) {
              continue;
            }
            if (!bool) {}
          }
          else
          {
            localx1.a(locale2, 1.0D);
            localx2.a(locale2, 0);
          }
          ((w)localObject1).f();
        } while (!bool);
        localObject1 = new h(i);
      } while (k != 0);
      ((h)localObject1).a(locale1);
      break label601;
      if (!((h)localObject1).g()) {
        break label832;
      }
      Object localObject2;
      Object localObject3;
      while (k != 0)
      {
        e locale3;
        do
        {
          locale2 = (e)((h)localObject1).c();
          localArrayList.add(locale2);
          do
          {
            localObject2 = locale2.h();
            do
            {
              if (localObject2 == null) {
                break;
              }
              locale3 = ((d)localObject2).f();
              if (bool) {
                break label581;
              }
              if (localx2.getInt(locale3) < 0)
              {
                ((h)localObject1).a(locale3);
                localx2.a(locale3, localx2.getInt(locale2) + 1);
              }
              if (k == 0)
              {
                if (localx2.getInt(locale3) == localx2.getInt(locale2) + 1)
                {
                  if (k == 0)
                  {
                    if (localx1.getDouble(locale3) + localx1.getDouble(locale2) > 1.7976931348623157E+308D) {
                      throw new ArithmeticException("Number of Paths between " + locale1 + " and " + locale3 + " overflows double");
                    }
                    localx1.a(locale3, localx1.getDouble(locale3) + localx1.getDouble(locale2));
                  }
                  localObject3 = (ArrayList)localx3.get(locale3);
                  ((ArrayList)localObject3).add(localObject2);
                  localx3.a(locale3, localObject3);
                }
                localObject2 = ((d)localObject2).i();
              }
            } while (!bool);
            if ((k != 0) || (paramBoolean)) {
              break;
            }
          } while (k != 0);
          if (bool) {
            break label871;
          }
          localObject2 = locale2.i();
          if (localObject2 == null) {
            break;
          }
          locale3 = ((d)localObject2).e();
        } while (bool);
        if (localx2.getInt(locale3) < 0)
        {
          ((h)localObject1).a(locale3);
          localx2.a(locale3, localx2.getInt(locale2) + 1);
        }
        if (k == 0)
        {
          if (localx2.getInt(locale3) == localx2.getInt(locale2) + 1)
          {
            if (k == 0)
            {
              if (localx1.getDouble(locale3) + localx1.getDouble(locale2) > 1.7976931348623157E+308D) {
                throw new ArithmeticException("Number of Paths between " + locale1 + " and " + locale3 + " overflows double");
              }
              localx1.a(locale3, localx1.getDouble(locale3) + localx1.getDouble(locale2));
            }
            localObject3 = (ArrayList)localx3.get(locale3);
            ((ArrayList)localObject3).add(localObject2);
            localx3.a(locale3, localObject3);
          }
          localObject2 = ((d)localObject2).j();
        }
        if (!bool) {
          break;
        }
        break label885;
      }
      if (!localArrayList.isEmpty()) {}
      while (k != 0)
      {
        locale2 = (e)localArrayList.remove(localArrayList.size() - 1);
        localObject2 = (ArrayList)localx3.get(locale2);
        int j = ((ArrayList)localObject2).size() - 1;
        if (j < 0) {
          break;
        }
        localObject3 = (d)((ArrayList)localObject2).get(j);
        e locale4 = ((d)localObject3).a(locale2);
        localx4.a(locale4, localx4.getDouble(locale4) + localx1.getDouble(locale4) / localx1.getDouble(locale2) * (localx4.getDouble(locale2) + 1.0D));
        localn.a(localObject3, localx1.getDouble(locale4) / localx1.getDouble(locale2) * (localx4.getDouble(locale2) + 1.0D));
        paramn.a(localObject3, paramn.getDouble(localObject3) + localn.getDouble(localObject3));
        j--;
        if ((k != 0) || (k != 0)) {
          break label1074;
        }
        if (bool) {
          break label1072;
        }
        if (k != 0) {
          break label1074;
        }
        if (bool) {
          break label1072;
        }
        if (!bool) {
          break;
        }
      }
      localw.f();
    } while (!bool);
    label159:
    label289:
    label581:
    return;
  }
  
  protected static void a(q paramq, n paramn, k paramk, boolean paramBoolean)
  {
    int m = m.b;
    boolean bool = m.a;
    if (m == 0) {
      if (paramq.m() == 0) {
        return;
      }
    }
    int i = paramq.k();
    double d1 = 0.01D;
    x localx1 = db.a(new double[i]);
    x localx2 = db.a(new double[i]);
    x localx3 = db.a(new ArrayList[i]);
    x localx4 = db.a(new double[i]);
    x localx5 = db.a(new double[i]);
    x localx6 = db.a(new boolean[i]);
    x localx7 = db.a(new double[i]);
    n localn = db.b(new double[paramq.m()]);
    c localc = new c(paramq);
    w localw = paramq.v();
    label206:
    label595:
    label746:
    label1270:
    do
    {
      e locale;
      ArrayList localArrayList1;
      Object localObject2;
      do
      {
        do
        {
          if (!localw.e()) {
            break;
          }
          locale = localw.d();
          localArrayList1 = new ArrayList();
          localObject1 = paramq.w();
          do
          {
            if (!((a.c.m)localObject1).e()) {
              break label206;
            }
            localn.a(((a.c.m)localObject1).a(), 0.0D);
            ((a.c.m)localObject1).f();
            if ((m == 0) && (bool)) {
              break;
            }
          } while (!bool);
        } while (m != 0);
        localObject1 = paramq.v();
        do
        {
          if (!((w)localObject1).e()) {
            break;
          }
          localObject2 = ((w)localObject1).d();
          localx3.a(localObject2, new ArrayList());
          localx4.a(localObject2, 0.0D);
          localx7.a(localObject2, 0.0D);
          if (bool) {
            break label392;
          }
          if (localObject2 != locale)
          {
            localx6.a(localObject2, false);
            localx1.a(localObject2, 0.0D);
            localx2.a(localObject2, 1.7976931348623157E+308D);
            localx5.a(localObject2, 1.7976931348623157E+308D);
            if (m != 0) {
              continue;
            }
            if (!bool) {}
          }
          else
          {
            localx1.a(localObject2, 1.0D);
            localx2.a(localObject2, 0.0D);
            localx6.a(localObject2, true);
          }
          ((w)localObject1).f();
        } while (!bool);
        localc.d();
      } while (m != 0);
      Object localObject1 = locale.h();
      ArrayList localArrayList2;
      do
      {
        if (localObject1 == null) {
          break;
        }
        localObject2 = ((d)localObject1).f();
        if (bool) {
          break label595;
        }
        if (paramk.getDouble(localObject1) == (1.0D / 0.0D)) {
          throw new ArithmeticException("Edge weight between " + locale + " and " + localObject2 + " overflows double");
        }
        localx5.a(localObject2, a(paramk, (d)localObject1));
        if (m == 0) {
          if (!localc.a((e)localObject2))
          {
            if (m != 0) {
              break label553;
            }
            localc.a((e)localObject2, localx5.getDouble(localObject2));
            if (!bool) {
              break label544;
            }
          }
        }
        localc.d((e)localObject2, localx5.getDouble(localObject2));
        localArrayList2 = (ArrayList)localx3.get(localObject2);
        localArrayList2.add(localObject1);
        localx3.a(localObject2, localArrayList2);
        localObject1 = ((d)localObject1).i();
      } while (!bool);
      if ((m == 0) && (!paramBoolean))
      {
        localObject1 = locale.i();
        do
        {
          if (localObject1 == null) {
            break;
          }
          localObject2 = ((d)localObject1).e();
          localx5.a(localObject2, a(paramk, (d)localObject1));
          if (bool) {
            break label746;
          }
          if (!localc.a((e)localObject2))
          {
            if (m != 0) {
              break label698;
            }
            localc.a((e)localObject2, localx5.getDouble(localObject2));
            if (!bool) {}
          }
          else
          {
            localc.d((e)localObject2, localx5.getDouble(localObject2));
          }
          localArrayList2 = (ArrayList)localx3.get(localObject2);
          localArrayList2.add(localObject1);
          localx3.a(localObject2, localArrayList2);
          localObject1 = ((d)localObject1).j();
        } while (!bool);
      }
      if (m == 0)
      {
        localArrayList1.add(locale);
        break label1290;
        if (!localc.a()) {
          break label1598;
        }
      }
      Object localObject3;
      Object localObject4;
      while (m != 0)
      {
        double d2;
        double d3;
        do
        {
          localObject1 = localc.b();
          localArrayList1.add(localObject1);
          localx2.a(localObject1, localx5.getDouble(localObject1));
          localx6.a(localObject1, true);
          do
          {
            localObject2 = (ArrayList)localx3.get(localObject1);
            int j = ((ArrayList)localObject2).size() - 1;
            do
            {
              do
              {
                if (j < 0) {
                  break;
                }
                localx1.a(localObject1, localx1.getDouble(localObject1) + localx1.getDouble(((d)((ArrayList)localObject2).get(j)).a((e)localObject1)));
                j--;
                if ((m == 0) && (bool)) {
                  break label949;
                }
              } while (!bool);
            } while (m != 0);
            if (localx1.getDouble(localObject1) == (1.0D / 0.0D)) {
              throw new ArithmeticException("Number of Paths between " + locale + " and " + localObject1 + " overflows double");
            }
            locald = ((e)localObject1).h();
            do
            {
              if (locald == null) {
                break;
              }
              localObject3 = locald.f();
              if (bool) {
                break label1270;
              }
              if (!localx6.getBool(localObject3))
              {
                d2 = localx2.getDouble(localObject1) + a(paramk, locald);
                d3 = localx5.getDouble(localObject3);
                if (m == 0) {
                  if (d2 == (1.0D / 0.0D)) {
                    throw new ArithmeticException("Distance between " + locale + " and " + localObject1 + " overflows double");
                  }
                }
                if (m == 0) {
                  if (Math.abs(d2 - d3) < d1)
                  {
                    localObject4 = (ArrayList)localx3.get(localObject3);
                    ((ArrayList)localObject4).add(locald);
                    localx3.a(localObject3, localObject4);
                    if (m != 0) {
                      continue;
                    }
                    if (!bool) {
                      break label1252;
                    }
                  }
                }
                if (m != 0) {
                  continue;
                }
                if (d2 < d3)
                {
                  localx5.a(localObject3, d2);
                  if (m == 0) {
                    if (!localc.a((e)localObject3))
                    {
                      if (m != 0) {
                        break label1223;
                      }
                      localc.a((e)localObject3, localx5.getDouble(localObject3));
                      if (!bool) {
                        break label1214;
                      }
                    }
                  }
                  localc.d((e)localObject3, localx5.getDouble(localObject3));
                  localObject4 = (ArrayList)localx3.get(localObject3);
                  ((ArrayList)localObject4).clear();
                  ((ArrayList)localObject4).add(locald);
                  localx3.a(localObject3, localObject4);
                }
              }
              locald = locald.i();
            } while (!bool);
            if ((m != 0) || (paramBoolean)) {
              break;
            }
          } while (m != 0);
          if (bool) {
            break label1637;
          }
          locald = ((e)localObject1).i();
          if (locald == null) {
            break;
          }
          localObject3 = locald.e();
        } while (bool);
        if (!localx6.getBool(localObject3))
        {
          d2 = localx2.getDouble(localObject1) + a(paramk, locald);
          d3 = localx5.getDouble(localObject3);
          if (m == 0) {
            if (d2 == (1.0D / 0.0D)) {
              throw new ArithmeticException("Distance between " + locale + " and " + localObject1 + " overflows double");
            }
          }
          if (m == 0) {
            if (Math.abs(d2 - d3) < d1)
            {
              localObject4 = (ArrayList)localx3.get(localObject3);
              ((ArrayList)localObject4).add(locald);
              localx3.a(localObject3, localObject4);
              if (m != 0) {
                break label1595;
              }
              if (!bool) {
                break label1586;
              }
            }
          }
          if (m != 0) {
            break label1595;
          }
          if (d2 < d3)
          {
            localx5.a(localObject3, d2);
            if (m == 0) {
              if (!localc.a((e)localObject3))
              {
                if (m != 0) {
                  break label1557;
                }
                localc.a((e)localObject3, localx5.getDouble(localObject3));
                if (!bool) {
                  break label1548;
                }
              }
            }
            localc.d((e)localObject3, localx5.getDouble(localObject3));
            localObject4 = (ArrayList)localx3.get(localObject3);
            ((ArrayList)localObject4).clear();
            ((ArrayList)localObject4).add(locald);
            localx3.a(localObject3, localObject4);
          }
        }
        d locald = locald.j();
        if (!bool) {
          break;
        }
        break label1651;
      }
      if (!localArrayList1.isEmpty()) {}
      while (m != 0)
      {
        localObject1 = (e)localArrayList1.remove(localArrayList1.size() - 1);
        localObject2 = (ArrayList)localx3.get(localObject1);
        int k = ((ArrayList)localObject2).size() - 1;
        if (k < 0) {
          break;
        }
        localObject3 = (d)((ArrayList)localObject2).get(k);
        localObject4 = ((d)localObject3).a((e)localObject1);
        localx7.a(localObject4, localx7.getDouble(localObject4) + localx1.getDouble(localObject4) / localx1.getDouble(localObject1) * (localx7.getDouble(localObject1) + 1.0D));
        localn.a(localObject3, localx1.getDouble(localObject4) / localx1.getDouble(localObject1) * (localx7.getDouble(localObject1) + 1.0D));
        paramn.a(localObject3, paramn.getDouble(localObject3) + localn.getDouble(localObject3));
        k--;
        if ((m != 0) || (m != 0)) {
          break label1840;
        }
        if (bool) {
          break label1838;
        }
        if (m != 0) {
          break label1840;
        }
        if (bool) {
          break label1838;
        }
        if (!bool) {
          break;
        }
      }
      localw.f();
    } while (!bool);
    label392:
    label544:
    label553:
    label698:
    label1214:
    label1223:
    label1252:
    label1637:
    label1651:
    return;
  }
  
  protected static void a(q paramq, x paramx, n paramn, boolean paramBoolean)
  {
    int k = m.b;
    boolean bool = m.a;
    if (k == 0) {
      if (paramq.m() == 0) {
        return;
      }
    }
    int i = paramq.k();
    x localx1 = db.a(new double[i]);
    x localx2 = db.a(new int[i]);
    x localx3 = db.a(new ArrayList[i]);
    x localx4 = db.a(new double[i]);
    n localn = db.b(new double[paramq.m()]);
    x localx5 = db.a(new double[i]);
    w localw = paramq.v();
    label94:
    label606:
    label626:
    label1274:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale1 = localw.d();
        ArrayList localArrayList = new ArrayList();
        Object localObject1;
        e locale2;
        do
        {
          localObject1 = paramq.w();
          do
          {
            if (!((a.c.m)localObject1).e()) {
              break label173;
            }
            localn.a(((a.c.m)localObject1).a(), 0.0D);
            ((a.c.m)localObject1).f();
            if ((k == 0) && (bool)) {
              break;
            }
          } while (!bool);
          if (k != 0) {
            break label94;
          }
          localObject1 = paramq.v();
          do
          {
            if (!((w)localObject1).e()) {
              break label313;
            }
            locale2 = ((w)localObject1).d();
            localx3.a(locale2, new ArrayList());
            localx4.a(locale2, 0.0D);
            localx5.a(locale2, 0.0D);
            if (bool) {
              break;
            }
            if (locale2 != locale1)
            {
              localx1.a(locale2, 0.0D);
              localx2.a(locale2, -1);
              if (k != 0) {
                continue;
              }
              if (!bool) {}
            }
            else
            {
              localx1.a(locale2, 1.0D);
              localx2.a(locale2, 0);
            }
            ((w)localObject1).f();
          } while (!bool);
          localObject1 = new h(i);
        } while (k != 0);
        ((h)localObject1).a(locale1);
        break label626;
        if (!((h)localObject1).g()) {}
        do
        {
          Object localObject3;
          while (k != 0)
          {
            locale2 = (e)((h)localObject1).c();
            localArrayList.add(locale2);
            do
            {
              localObject2 = locale2.h();
              do
              {
                if (localObject2 == null) {
                  break;
                }
                locale3 = ((d)localObject2).f();
                if (bool) {
                  break label606;
                }
                if (localx2.getInt(locale3) < 0)
                {
                  ((h)localObject1).a(locale3);
                  localx2.a(locale3, localx2.getInt(locale2) + 1);
                }
                if (k == 0)
                {
                  if (localx2.getInt(locale3) == localx2.getInt(locale2) + 1)
                  {
                    if (k == 0)
                    {
                      if (localx1.getDouble(locale3) + localx1.getDouble(locale2) > 1.7976931348623157E+308D) {
                        throw new ArithmeticException("Number of Paths between " + locale1 + " and " + locale3 + " overflows double");
                      }
                      localx1.a(locale3, localx1.getDouble(locale3) + localx1.getDouble(locale2));
                    }
                    localObject3 = (ArrayList)localx3.get(locale3);
                    ((ArrayList)localObject3).add(localObject2);
                    localx3.a(locale3, localObject3);
                  }
                  localObject2 = ((d)localObject2).i();
                }
              } while (!bool);
              if ((k != 0) || (paramBoolean)) {
                break;
              }
            } while (k != 0);
            if (bool) {
              break label896;
            }
            localObject2 = locale2.i();
            if (localObject2 == null) {
              break label336;
            }
            e locale3 = ((d)localObject2).e();
            if (bool) {
              break label341;
            }
            if (localx2.getInt(locale3) < 0)
            {
              ((h)localObject1).a(locale3);
              localx2.a(locale3, localx2.getInt(locale2) + 1);
            }
            if (k == 0)
            {
              if (localx2.getInt(locale3) == localx2.getInt(locale2) + 1)
              {
                if (k == 0)
                {
                  if (localx1.getDouble(locale3) + localx1.getDouble(locale2) > 1.7976931348623157E+308D) {
                    throw new ArithmeticException("Number of Paths between " + locale1 + " and " + locale3 + " overflows double");
                  }
                  localx1.a(locale3, localx1.getDouble(locale3) + localx1.getDouble(locale2));
                }
                localObject3 = (ArrayList)localx3.get(locale3);
                ((ArrayList)localObject3).add(localObject2);
                localx3.a(locale3, localObject3);
              }
              localObject2 = ((d)localObject2).j();
            }
            if (!bool) {
              break;
            }
          }
          if (localArrayList.isEmpty()) {
            break label1265;
          }
          locale2 = (e)localArrayList.remove(localArrayList.size() - 1);
          Object localObject2 = (ArrayList)localx3.get(locale2);
          double d2;
          do
          {
            int j = ((ArrayList)localObject2).size() - 1;
            if (j >= 0) {}
            while (k != 0)
            {
              localObject3 = (d)((ArrayList)localObject2).get(j);
              e locale4 = ((d)localObject3).a(locale2);
              double d1 = localx4.getDouble(locale4) + localx1.getDouble(locale4) * (1.0D + localx4.getDouble(locale2)) / localx1.getDouble(locale2);
              if (bool) {
                break;
              }
              if (d1 == (1.0D / 0.0D)) {
                throw new ArithmeticException("Centrality index of " + locale4 + " too high");
              }
              localx4.a(locale4, d1);
              localx5.a(locale4, localx5.getDouble(locale4) + localx1.getDouble(locale4) / localx1.getDouble(locale2) * (localx5.getDouble(locale2) + 1.0D));
              localn.a(localObject3, localx1.getDouble(locale4) / localx1.getDouble(locale2) * (localx5.getDouble(locale2) + 1.0D));
              paramn.a(localObject3, paramn.getDouble(localObject3) + localn.getDouble(localObject3));
              j--;
              if (!bool) {
                break label910;
              }
            }
            if (locale2 == locale1) {
              break;
            }
            d2 = paramx.getDouble(locale2) + localx4.getDouble(locale2);
          } while (k != 0);
          if (bool) {
            break;
          }
          if (d2 == (1.0D / 0.0D)) {
            throw new ArithmeticException("Centrality index of " + locale2 + " too high");
          }
          paramx.a(locale2, d2);
          if (k != 0) {
            break label1274;
          }
        } while (!bool);
        localw.f();
      } while (!bool);
    } while (k != 0);
    label173:
    label313:
    label336:
    label341:
    label1265:
    return;
  }
  
  protected static void a(q paramq, x paramx, n paramn, k paramk, boolean paramBoolean)
  {
    int m = m.b;
    boolean bool = m.a;
    if (m == 0) {
      if (paramq.m() == 0) {
        return;
      }
    }
    int i = paramq.k();
    double d1 = 0.01D;
    x localx1 = db.a(new double[i]);
    x localx2 = db.a(new double[i]);
    x localx3 = db.a(new ArrayList[i]);
    x localx4 = db.a(new double[i]);
    x localx5 = db.a(new double[i]);
    x localx6 = db.a(new boolean[i]);
    x localx7 = db.a(new double[i]);
    n localn = db.b(new double[paramq.m()]);
    c localc = new c(paramq);
    w localw = paramq.v();
    label127:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale = localw.d();
        do
        {
          ArrayList localArrayList1 = new ArrayList();
          Object localObject3;
          Object localObject4;
          while (m != 0)
          {
            localObject1 = paramq.w();
            do
            {
              if (!((a.c.m)localObject1).e()) {
                break label206;
              }
              localn.a(((a.c.m)localObject1).a(), 0.0D);
              ((a.c.m)localObject1).f();
              if ((m == 0) && (bool)) {
                break;
              }
            } while (!bool);
            if (m != 0) {
              break label127;
            }
            localObject1 = paramq.v();
            do
            {
              if (!((w)localObject1).e()) {
                break;
              }
              localObject2 = ((w)localObject1).d();
              localx3.a(localObject2, new ArrayList());
              localx4.a(localObject2, 0.0D);
              localx7.a(localObject2, 0.0D);
              if (bool) {
                break label392;
              }
              if (localObject2 != locale)
              {
                localx6.a(localObject2, false);
                localx1.a(localObject2, 0.0D);
                localx2.a(localObject2, 1.7976931348623157E+308D);
                localx5.a(localObject2, 1.7976931348623157E+308D);
                if (m != 0) {
                  continue;
                }
                if (!bool) {}
              }
              else
              {
                localx1.a(localObject2, 1.0D);
                localx2.a(localObject2, 0.0D);
                localx6.a(localObject2, true);
              }
              ((w)localObject1).f();
            } while (!bool);
            localc.d();
            if (m != 0) {
              break;
            }
            localObject1 = locale.h();
            ArrayList localArrayList2;
            do
            {
              if (localObject1 == null) {
                break;
              }
              localObject2 = ((d)localObject1).f();
              if (bool) {
                break label596;
              }
              if (paramk.getDouble(localObject1) == (1.0D / 0.0D)) {
                throw new ArithmeticException("Edge weight between " + locale + " and " + localObject2 + " overflows double");
              }
              localx5.a(localObject2, a(paramk, (d)localObject1));
              if (m == 0) {
                if (!localc.a((e)localObject2))
                {
                  if (m != 0) {
                    break label553;
                  }
                  localc.a((e)localObject2, localx5.getDouble(localObject2));
                  if (!bool) {
                    break label544;
                  }
                }
              }
              localc.d((e)localObject2, localx5.getDouble(localObject2));
              localArrayList2 = (ArrayList)localx3.get(localObject2);
              localArrayList2.add(localObject1);
              localx3.a(localObject2, localArrayList2);
              localObject1 = ((d)localObject1).i();
            } while (!bool);
            if ((m == 0) && (!paramBoolean))
            {
              localObject1 = locale.i();
              do
              {
                if (localObject1 == null) {
                  break;
                }
                localObject2 = ((d)localObject1).e();
                localx5.a(localObject2, a(paramk, (d)localObject1));
                if (bool) {
                  break label747;
                }
                if (!localc.a((e)localObject2))
                {
                  if (m != 0) {
                    break label699;
                  }
                  localc.a((e)localObject2, localx5.getDouble(localObject2));
                  if (!bool) {}
                }
                else
                {
                  localc.d((e)localObject2, localx5.getDouble(localObject2));
                }
                localArrayList2 = (ArrayList)localx3.get(localObject2);
                localArrayList2.add(localObject1);
                localx3.a(localObject2, localArrayList2);
                localObject1 = ((d)localObject1).j();
              } while (!bool);
            }
            if (m != 0) {
              break label1607;
            }
            do
            {
              localArrayList1.add(locale);
              double d2;
              double d5;
              do
              {
                do
                {
                  if (localc.a()) {
                    break;
                  }
                  localObject1 = localc.b();
                  localArrayList1.add(localObject1);
                  localx2.a(localObject1, localx5.getDouble(localObject1));
                  localx6.a(localObject1, true);
                  do
                  {
                    localObject2 = (ArrayList)localx3.get(localObject1);
                    int j = ((ArrayList)localObject2).size() - 1;
                    do
                    {
                      do
                      {
                        if (j < 0) {
                          break;
                        }
                        localx1.a(localObject1, localx1.getDouble(localObject1) + localx1.getDouble(((d)((ArrayList)localObject2).get(j)).a((e)localObject1)));
                        j--;
                        if ((m == 0) && (bool)) {
                          break label950;
                        }
                      } while (!bool);
                    } while (m != 0);
                    if (localx1.getDouble(localObject1) == (1.0D / 0.0D)) {
                      throw new ArithmeticException("Number of Paths between " + locale + " and " + localObject1 + " overflows double");
                    }
                    locald = ((e)localObject1).h();
                    do
                    {
                      if (locald == null) {
                        break;
                      }
                      localObject3 = locald.f();
                      if (bool) {
                        break label1272;
                      }
                      if (!localx6.getBool(localObject3))
                      {
                        d2 = localx2.getDouble(localObject1) + a(paramk, locald);
                        d5 = localx5.getDouble(localObject3);
                        if (m == 0) {
                          if (d2 == (1.0D / 0.0D)) {
                            throw new ArithmeticException("Distance between " + locale + " and " + localObject1 + " overflows double");
                          }
                        }
                        if (m == 0) {
                          if (Math.abs(d2 - d5) < d1)
                          {
                            localObject4 = (ArrayList)localx3.get(localObject3);
                            ((ArrayList)localObject4).add(locald);
                            localx3.a(localObject3, localObject4);
                            if (m != 0) {
                              continue;
                            }
                            if (!bool) {
                              break label1253;
                            }
                          }
                        }
                        if (m != 0) {
                          continue;
                        }
                        if (d2 < d5)
                        {
                          localx5.a(localObject3, d2);
                          if (m == 0) {
                            if (!localc.a((e)localObject3))
                            {
                              if (m != 0) {
                                break label1224;
                              }
                              localc.a((e)localObject3, localx5.getDouble(localObject3));
                              if (!bool) {
                                break label1215;
                              }
                            }
                          }
                          localc.d((e)localObject3, localx5.getDouble(localObject3));
                          localObject4 = (ArrayList)localx3.get(localObject3);
                          ((ArrayList)localObject4).clear();
                          ((ArrayList)localObject4).add(locald);
                          localx3.a(localObject3, localObject4);
                        }
                      }
                      locald = locald.i();
                    } while (!bool);
                    if ((m != 0) || (paramBoolean)) {
                      break;
                    }
                  } while (m != 0);
                  if (bool) {
                    break label1639;
                  }
                  locald = ((e)localObject1).i();
                } while (locald == null);
                localObject3 = locald.e();
              } while (bool);
              if (!localx6.getBool(localObject3))
              {
                d2 = localx2.getDouble(localObject1) + a(paramk, locald);
                d5 = localx5.getDouble(localObject3);
                if (m == 0) {
                  if (d2 == (1.0D / 0.0D)) {
                    throw new ArithmeticException("Distance between " + locale + " and " + localObject1 + " overflows double");
                  }
                }
                if (m == 0) {
                  if (Math.abs(d2 - d5) < d1)
                  {
                    localObject4 = (ArrayList)localx3.get(localObject3);
                    ((ArrayList)localObject4).add(locald);
                    localx3.a(localObject3, localObject4);
                    if (m != 0) {
                      continue;
                    }
                    if (!bool) {
                      break label1588;
                    }
                  }
                }
                if (m != 0) {
                  continue;
                }
                if (d2 < d5)
                {
                  localx5.a(localObject3, d2);
                  if (m == 0) {
                    if (!localc.a((e)localObject3))
                    {
                      if (m != 0) {
                        break label1559;
                      }
                      localc.a((e)localObject3, localx5.getDouble(localObject3));
                      if (!bool) {
                        break label1550;
                      }
                    }
                  }
                  localc.d((e)localObject3, localx5.getDouble(localObject3));
                  localObject4 = (ArrayList)localx3.get(localObject3);
                  ((ArrayList)localObject4).clear();
                  ((ArrayList)localObject4).add(locald);
                  localx3.a(localObject3, localObject4);
                }
              }
              d locald = locald.j();
            } while (!bool);
          }
          if (localArrayList1.isEmpty()) {
            break label2008;
          }
          Object localObject1 = (e)localArrayList1.remove(localArrayList1.size() - 1);
          Object localObject2 = (ArrayList)localx3.get(localObject1);
          double d4;
          do
          {
            int k = ((ArrayList)localObject2).size() - 1;
            if (k >= 0) {}
            while (m != 0)
            {
              localObject3 = (d)((ArrayList)localObject2).get(k);
              localObject4 = ((d)localObject3).a((e)localObject1);
              double d3 = localx4.getDouble(localObject4) + localx1.getDouble(localObject4) * (1.0D + localx4.getDouble(localObject1)) / localx1.getDouble(localObject1);
              if (bool) {
                break;
              }
              if (d3 == (1.0D / 0.0D)) {
                throw new ArithmeticException("Centrality index of " + localObject4 + " too high");
              }
              localx4.a(localObject4, d3);
              localx7.a(localObject4, localx7.getDouble(localObject4) + localx1.getDouble(localObject4) / localx1.getDouble(localObject1) * (localx7.getDouble(localObject1) + 1.0D));
              localn.a(localObject3, localx1.getDouble(localObject4) / localx1.getDouble(localObject1) * (localx7.getDouble(localObject1) + 1.0D));
              paramn.a(localObject3, paramn.getDouble(localObject3) + localn.getDouble(localObject3));
              k--;
              if (!bool) {
                break label1653;
              }
            }
            if (localObject1 == locale) {
              break;
            }
            d4 = paramx.getDouble(localObject1) + localx4.getDouble(localObject1);
          } while (m != 0);
          if (bool) {
            break label132;
          }
          if (d4 == (1.0D / 0.0D)) {
            throw new ArithmeticException("Centrality index of " + localObject1 + " too high");
          }
          paramx.a(localObject1, d4);
          if (m != 0) {
            break label2017;
          }
        } while (!bool);
        localw.f();
      } while (!bool);
    } while (m != 0);
    label132:
    label206:
    label596:
    label747:
    label1272:
    return;
  }
  
  private static void a(double paramDouble, Object paramObject)
  {
    if ((m.b != 0) || ((paramDouble == (1.0D / 0.0D)) || (Double.isNaN(paramDouble)))) {
      throw new ArithmeticException("Value of element '" + paramObject + "' is too large.");
    }
  }
  
  private static void a(c paramc, e parame, double paramDouble)
  {
    int i = m.b;
    if (i == 0) {
      if (paramc.a(parame))
      {
        if (i != 0) {
          break label38;
        }
        paramc.d(parame, paramDouble);
        if (!m.a) {
          return;
        }
      }
    }
    label38:
    paramc.a(parame, paramDouble);
  }
  
  private static double a(k paramk, d paramd)
  {
    double d = paramk.getDouble(paramd);
    if (m.b == 0) {}
    return d < 0.0001D ? 1.0D : d;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.a.v

 * JD-Core Version:    0.7.0.1

 */